<table class="table table-hover">
    <thead>
    <tr>
        <th><input type="checkbox" class="grid-select-all" />&nbsp;</th>
        <th>申请站点</th>
        <th>申请人</th>
        <th>SKU</th>
        <th>挪出站点</th>
        <th>申请数量</th>
        <th>提交时间</th>
        <th>产品名称</th>
    </tr>
    </thead>
    <tbody>
    @foreach($paginator as $row)
        <tr>
            <td><input type="checkbox" class="grid-row-checkbox" data-id="{{ $row->id }}" /></td>
            <td>{{ $row->iArea->area ?? '' }}</td>
            <td>{{ \App\Util\User::getUsernameById($row->iuser_id) }}</td>
            <td>{{ $row->sku->psku_code ?? '' }}</td>
            <td>{{ $row->oArea->area ?? '' }}</td>
            <td>{{ $row->transfer_num }}</td>
            <td>{{ $row->created_at }}</td>
            <td>{{ $row->sku->psku_cn ?? '' }}</td>
        </tr>
    @endforeach
    </tbody>
</table>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('.grid-row-checkbox').iCheck({checkboxClass:'icheckbox_minimal-blue'}).on('ifChanged', function () {
            if (this.checked) {
                $(this).closest('tr').css('background-color', '#ffffd5');
            } else {
                $(this).closest('tr').css('background-color', '');
            }
        });
        $('.grid-select-all').iCheck({checkboxClass:'icheckbox_minimal-blue'});
        $('.grid-select-all').on('ifChanged', function(event) {
            if (this.checked) {
                $('.grid-row-checkbox').iCheck('check');
            } else {
                $('.grid-row-checkbox').iCheck('uncheck');
            }
        });
    });
</script>
